<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Generating emptiness and identity</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. The Variadic Macro Data Library 1.10">
<link rel="up" href="../vmd_useful.html" title="Useful variadic macros not in Boost PP">
<link rel="prev" href="../vmd_useful.html" title="Useful variadic macros not in Boost PP">
<link rel="next" href="vmd_empty_ppdata.html" title='Functionality for "empty" seqs and tuples'>
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../vmd_useful.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../vmd_useful.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="vmd_empty_ppdata.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="variadic_macro_data.vmd_useful.vmd_identity"></a><a class="link" href="vmd_identity.html" title="Generating emptiness and identity">Generating
      emptiness and identity</a>
</h3></div></div></div>
<h5>
<a name="variadic_macro_data.vmd_useful.vmd_identity.h0"></a>
        <span class="phrase"><a name="variadic_macro_data.vmd_useful.vmd_identity.using_boost_pp_empty_and_boost_p"></a></span><a class="link" href="vmd_identity.html#variadic_macro_data.vmd_useful.vmd_identity.using_boost_pp_empty_and_boost_p">Using
        BOOST_PP_EMPTY and BOOST_PP_IDENTITY</a>
      </h5>
<p>
        Boost PP Has a macro called BOOST_PP_EMPTY() which expands to nothing.
      </p>
<p>
        Ordinarily this would not seem that useful, but the macro can be used in
        situations where one wants to return a specific value even though a further
        macro call syntax is required taking no parameters. This sort of usefulness
        occurs in Boost PP when there are two paths to take depending on the outcome
        of a BOOST_PP_IF or BOOST_PP_IIF logic. Here is an artificial example:
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">control</span><span class="special">/</span><span class="identifier">iif</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">facilities</span><span class="special">/</span><span class="identifier">empty</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>

<span class="preprocessor">#define</span> <span class="identifier">MACRO_CHOICE</span><span class="special">(</span><span class="identifier">parameter</span><span class="special">)</span> <span class="special">\</span>
    <span class="identifier">BOOST_PP_IIF</span><span class="special">(</span><span class="identifier">parameter</span><span class="special">)</span> <span class="special">\</span>
        <span class="special">(</span> <span class="special">\</span>
        <span class="identifier">MACRO_CALL_IF_PARAMETER_1</span><span class="special">,</span> <span class="special">\</span>
        <span class="identifier">SOME_FIXED_VALUE</span> <span class="identifier">BOOST_PP_EMPTY</span> <span class="special">\</span>
        <span class="special">)</span> <span class="special">\</span>
    <span class="special">()</span>

<span class="preprocessor">#define</span> <span class="identifier">MACRO_CALL_IF_PARAMETER_1</span><span class="special">()</span> <span class="identifier">some_processing</span>
</pre>
<p>
        In the general logic above is: if parameter is 1 another macro is invoked,
        whereas if the parameter is 0 some fixed value is returned. The reason that
        this is useful is that one may not want to code the MACRO_CHOICE macro in
        this way:
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">control</span><span class="special">/</span><span class="identifier">iif</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>

<span class="preprocessor">#define</span> <span class="identifier">MACRO_CHOICE</span><span class="special">(</span><span class="identifier">parameter</span><span class="special">)</span> <span class="special">\</span>
    <span class="identifier">BOOST_PP_IIF</span><span class="special">(</span><span class="identifier">parameter</span><span class="special">)</span> <span class="special">\</span>
        <span class="special">(</span> <span class="special">\</span>
        <span class="identifier">MACRO_CALL_IF_PARAMETER_1</span><span class="special">(),</span> <span class="special">\</span>
        <span class="identifier">SOME_FIXED_VALUE</span> <span class="special">\</span>
        <span class="special">)</span>

<span class="preprocessor">#define</span> <span class="identifier">MACRO_CALL_IF_PARAMETER_1</span><span class="special">()</span> <span class="identifier">some_processing</span>
</pre>
<p>
        because it is inefficient. The invocation of MACRO_CALL_IF_PARAMETER_1 will
        still be generated even when 'parameter' is 0.
      </p>
<p>
        This idiom of returning a fixed value through the use of BOOST_PP_EMPTY is
        so useful that Boost PP has an accompanying macro to BOOST_PP_EMPTY to work
        with it. This accompanying macro is BOOST_PP_IDENTITY(value)(). Essentially
        BOOST_PP_IDENTITY returns its value when it is invoked. Again, like BOOST_PP_EMPTY,
        the final invocation must be done with no value.
      </p>
<p>
        Our example from above, which originally used BOOST_PP_EMPTY to return a
        fixed value, is now:
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">control</span><span class="special">/</span><span class="identifier">iif</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">facilities</span><span class="special">/</span><span class="identifier">identity</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>

<span class="preprocessor">#define</span> <span class="identifier">MACRO_CHOICE</span><span class="special">(</span><span class="identifier">parameter</span><span class="special">)</span> <span class="special">\</span>
    <span class="identifier">BOOST_PP_IIF</span><span class="special">(</span><span class="identifier">parameter</span><span class="special">)</span> <span class="special">\</span>
        <span class="special">(</span> <span class="special">\</span>
        <span class="identifier">MACRO_CALL_IF_PARAMETER_1</span><span class="special">,</span> <span class="special">\</span>
        <span class="identifier">BOOST_PP_IDENTITY</span><span class="special">(</span><span class="identifier">SOME_FIXED_VALUE</span><span class="special">)</span> <span class="special">\</span>
        <span class="special">)</span> <span class="special">\</span>
    <span class="special">()</span>

<span class="preprocessor">#define</span> <span class="identifier">MACRO_CALL_IF_PARAMETER_1</span><span class="special">()</span> <span class="identifier">some_processing</span>
</pre>
<p>
        The macro BOOST_PP_IDENTITY is actually just:
      </p>
<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">BOOST_PP_IDENTITY</span><span class="special">(</span><span class="identifier">value</span><span class="special">)</span> <span class="identifier">value</span> <span class="identifier">BOOST_PP_EMPTY</span>
</pre>
<p>
        so you can see how it is essentially a shorthand for the common case originally
        shown at the top of returning a value through the use of BOOST_PP_EMPTY.
      </p>
<h5>
<a name="variadic_macro_data.vmd_useful.vmd_identity.h1"></a>
        <span class="phrase"><a name="variadic_macro_data.vmd_useful.vmd_identity.using_boost_vmd_empty_and_boost_"></a></span><a class="link" href="vmd_identity.html#variadic_macro_data.vmd_useful.vmd_identity.using_boost_vmd_empty_and_boost_">Using
        BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY</a>
      </h5>
<p>
        The one problem when using BOOST_PP_EMPTY and BOOST_PP_IDENTITY is that the
        final invocation must be with no parameters. This is very limiting. If the
        final invocation must be with one or more parameters you cannot use BOOST_PP_EMPTY
        or BOOST_PP_IDENTITY. In other words, making a change to either of our two
        examples:
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">control</span><span class="special">/</span><span class="identifier">iif</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">facilities</span><span class="special">/</span><span class="identifier">empty</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>

<span class="preprocessor">#define</span> <span class="identifier">MACRO_CHOICE</span><span class="special">(</span><span class="identifier">parameter1</span><span class="special">,</span><span class="identifier">parameter2</span><span class="special">)</span> <span class="special">\</span>
    <span class="identifier">BOOST_PP_IIF</span><span class="special">(</span><span class="identifier">parameter1</span><span class="special">)</span> <span class="special">\</span>
        <span class="special">(</span> <span class="special">\</span>
        <span class="identifier">MACRO_CALL_IF_PARAMETER_1</span><span class="special">,</span> <span class="special">\</span>
        <span class="identifier">SOME_FIXED_VALUE</span> <span class="identifier">BOOST_PP_EMPTY</span> <span class="special">\</span>
        <span class="special">)</span> <span class="special">\</span>
    <span class="special">(</span><span class="identifier">parameter2</span><span class="special">)</span>

<span class="preprocessor">#define</span> <span class="identifier">MACRO_CALL_IF_PARAMETER_1</span><span class="special">(</span><span class="identifier">parameter2</span><span class="special">)</span> <span class="identifier">some_processing_using_a_parameter</span>
</pre>
<p>
        or
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">control</span><span class="special">/</span><span class="identifier">iif</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">facilities</span><span class="special">/</span><span class="identifier">identity</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>

<span class="preprocessor">#define</span> <span class="identifier">MACRO_CHOICE</span><span class="special">(</span><span class="identifier">parameter1</span><span class="special">,</span><span class="identifier">parameter2</span><span class="special">)</span> <span class="special">\</span>
    <span class="identifier">BOOST_PP_IIF</span><span class="special">(</span><span class="identifier">parameter1</span><span class="special">)</span> <span class="special">\</span>
        <span class="special">(</span> <span class="special">\</span>
        <span class="identifier">MACRO_CALL_IF_PARAMETER_1</span><span class="special">,</span> <span class="special">\</span>
        <span class="identifier">BOOST_PP_IDENTITY</span><span class="special">(</span><span class="identifier">SOME_FIXED_VALUE</span><span class="special">)</span> <span class="special">\</span>
        <span class="special">)</span> <span class="special">\</span>
    <span class="special">(</span><span class="identifier">parameter2</span><span class="special">)</span>

<span class="preprocessor">#define</span> <span class="identifier">MACRO_CALL_IF_PARAMETER_1</span><span class="special">(</span><span class="identifier">parameter2</span><span class="special">)</span> <span class="identifier">some_processing_using_a_parameter</span>
</pre>
<p>
        will produce a preprocessing error since the final invocation to either BOOST_PP_EMPTY
        or BOOST_PP_IDENTITY can not be done with 1 or more parameters.
      </p>
<p>
        It would be much more useful if the final invocation could be done with any
        number of parameters. This is where using variadic macros solves the problem.
        The BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY macros have the exact same functionality
        as their Boost PP counterparts but the final invocation can be made with
        any number of parameters, and those parameters are just ignored when BOOST_VMD_EMPTY
        or BOOST_VMD_IDENTITY is the choice.
      </p>
<p>
        Now for our two examples we can have:
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">control</span><span class="special">/</span><span class="identifier">iif</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">vmd</span><span class="special">/</span><span class="identifier">empty</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>

<span class="preprocessor">#define</span> <span class="identifier">MACRO_CHOICE</span><span class="special">(</span><span class="identifier">parameter1</span><span class="special">,</span><span class="identifier">parameter2</span><span class="special">)</span> <span class="special">\</span>
    <span class="identifier">BOOST_PP_IIF</span><span class="special">(</span><span class="identifier">parameter1</span><span class="special">)</span> <span class="special">\</span>
        <span class="special">(</span> <span class="special">\</span>
        <span class="identifier">MACRO_CALL_IF_PARAMETER_1</span><span class="special">,</span> <span class="special">\</span>
        <span class="identifier">SOME_FIXED_VALUE</span> <span class="identifier">BOOST_VMD_EMPTY</span> <span class="special">\</span>
        <span class="special">)</span> <span class="special">\</span>
    <span class="special">(</span><span class="identifier">parameter2</span><span class="special">)</span>

<span class="preprocessor">#define</span> <span class="identifier">MACRO_CALL_IF_PARAMETER_1</span><span class="special">(</span><span class="identifier">parameter2</span><span class="special">)</span> <span class="identifier">some_processing_using_parameters</span>
</pre>
<p>
        or
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">control</span><span class="special">/</span><span class="identifier">iif</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">vmd</span><span class="special">/</span><span class="identifier">identity</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>

<span class="preprocessor">#define</span> <span class="identifier">MACRO_CHOICE</span><span class="special">(</span><span class="identifier">parameter1</span><span class="special">,</span><span class="identifier">parameter2</span><span class="special">)</span> <span class="special">\</span>
    <span class="identifier">BOOST_PP_IIF</span><span class="special">(</span><span class="identifier">parameter1</span><span class="special">)</span> <span class="special">\</span>
        <span class="special">(</span> <span class="special">\</span>
        <span class="identifier">MACRO_CALL_IF_PARAMETER_1</span><span class="special">,</span> <span class="special">\</span>
        <span class="identifier">BOOST_VMD_IDENTITY</span><span class="special">(</span><span class="identifier">SOME_FIXED_VALUE</span><span class="special">)</span> <span class="special">\</span>
        <span class="special">)</span> <span class="special">\</span>
    <span class="special">(</span><span class="identifier">parameter2</span><span class="special">)</span>

<span class="preprocessor">#define</span> <span class="identifier">MACRO_CALL_IF_PARAMETER_1</span><span class="special">(</span><span class="identifier">parameter2</span><span class="special">)</span> <span class="identifier">some_processing_using_parameters</span>
</pre>
<p>
        and our macros will compile without preprocessing errors and work as expected.
        Both BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY will take any number of parameters
        in their invocation, which makes them useful for a final invocation no matter
        what is being passed.
      </p>
<h5>
<a name="variadic_macro_data.vmd_useful.vmd_identity.h2"></a>
        <span class="phrase"><a name="variadic_macro_data.vmd_useful.vmd_identity.usage_for_boost_vmd_empty_and_bo"></a></span><a class="link" href="vmd_identity.html#variadic_macro_data.vmd_useful.vmd_identity.usage_for_boost_vmd_empty_and_bo">Usage
        for BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY</a>
      </h5>
<p>
        To use the BOOST_VMD_EMPTY macro either include the general header:
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">vmd</span><span class="special">/</span><span class="identifier">vmd</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre>
<p>
        or include the specific header:
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">vmd</span><span class="special">/</span><span class="identifier">empty</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre>
<p>
        To use the BOOST_VMD_IDENTITY macro either include the general header:
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">vmd</span><span class="special">/</span><span class="identifier">vmd</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre>
<p>
        or include the specific header:
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">vmd</span><span class="special">/</span><span class="identifier">identity</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre>
<h5>
<a name="variadic_macro_data.vmd_useful.vmd_identity.h3"></a>
        <span class="phrase"><a name="variadic_macro_data.vmd_useful.vmd_identity.using_boost_vmd_empty_and_boost0"></a></span><a class="link" href="vmd_identity.html#variadic_macro_data.vmd_useful.vmd_identity.using_boost_vmd_empty_and_boost0">Using
        BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY with VC++</a>
      </h5>
<p>
        Unfortunately the Visual C++ default preprocessor has a problem when a macro
        expands to something followed by a variadic macro which expands to nothing.
        This is the case when using BOOST_VMD_EMPTY following some non-empty expansion,
        or the equivalent use of BOOST_VMD_IDENTITY. As strange as it sounds this
        VC++ default preprocessor problem is normally solved by concatenating the
        result using BOOST_PP_CAT with an empty value. But then again the many non-standard
        behaviors of VC++ with its default preprocessor are difficult to understand
        or even track.
      </p>
<p>
        In order to make this technique transparent when used with a C++ standard
        conforming preprocessor or the VC++ non-standard default preprocessor you
        can use the BOOST_VMD_IDENTITY_RESULT macro passing to it a single parameter
        which is a result returned from a macro which uses BOOST_VMD_IDENTITY ( or
        its equivalent 'value BOOST_VMD_EMPTY' usage ).
      </p>
<p>
        Given our MACRO_CHOICE example above, if you have another macro invoking
        MACRO_CHOICE simply enclose that invocation within BOOST_VMD_IDENTITY_RESULT.
        As in the very simple:
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">vmd</span><span class="special">/</span><span class="identifier">identity</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>

<span class="preprocessor">#define</span> <span class="identifier">CALLING_MACRO_CHOICE</span><span class="special">(</span><span class="identifier">parameter1</span><span class="special">,</span><span class="identifier">parameter2</span><span class="special">)</span> <span class="special">\</span>
    <span class="identifier">BOOST_VMD_IDENTITY_RESULT</span><span class="special">(</span><span class="identifier">MACRO_CHOICE</span><span class="special">(</span><span class="identifier">parameter1</span><span class="special">,</span><span class="identifier">parameter2</span><span class="special">))</span>
</pre>
<p>
        Alternatively you can change MACRO_CHOICE so that its implementation and
        usage is:
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">preprocessor</span><span class="special">/</span><span class="identifier">control</span><span class="special">/</span><span class="identifier">iif</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">vmd</span><span class="special">/</span><span class="identifier">identity</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>

<span class="preprocessor">#define</span> <span class="identifier">MACRO_CHOICE</span><span class="special">(</span><span class="identifier">parameter1</span><span class="special">,</span><span class="identifier">parameter2</span><span class="special">)</span> <span class="special">\</span>
    <span class="identifier">BOOST_VMD_IDENTITY_RESULT</span> <span class="special">\</span>
        <span class="special">(</span> <span class="special">\</span>
        <span class="identifier">BOOST_PP_IIF</span><span class="special">(</span><span class="identifier">parameter1</span><span class="special">)</span> <span class="special">\</span>
            <span class="special">(</span> <span class="special">\</span>
            <span class="identifier">MACRO_CALL_IF_PARAMETER_1</span><span class="special">,</span> <span class="special">\</span>
            <span class="identifier">BOOST_VMD_IDENTITY</span><span class="special">(</span><span class="identifier">SOME_FIXED_VALUE</span><span class="special">)</span> <span class="special">\</span>
            <span class="special">)</span> <span class="special">\</span>
        <span class="special">(</span><span class="identifier">parameter2</span><span class="special">)</span> <span class="special">\</span>
        <span class="special">)</span>

<span class="preprocessor">#define</span> <span class="identifier">CALLING_MACRO_CHOICE</span><span class="special">(</span><span class="identifier">parameter1</span><span class="special">,</span><span class="identifier">parameter2</span><span class="special">)</span> <span class="special">\</span>
    <span class="identifier">MACRO_CHOICE</span><span class="special">(</span><span class="identifier">parameter1</span><span class="special">,</span><span class="identifier">parameter2</span><span class="special">)</span>
</pre>
<p>
        Using BOOST_VMD_EMPTY and BOOST_VMD_IDENTITY in this way will ensure they
        can be used without preprocessing problems with either VC++ with its default
        preprocessor or any C++ standard conforming preprocessor.
      </p>
<h5>
<a name="variadic_macro_data.vmd_useful.vmd_identity.h4"></a>
        <span class="phrase"><a name="variadic_macro_data.vmd_useful.vmd_identity.usage_for_boost_vmd_identity_res"></a></span><a class="link" href="vmd_identity.html#variadic_macro_data.vmd_useful.vmd_identity.usage_for_boost_vmd_identity_res">Usage
        for BOOST_VMD_IDENTITY_RESULT</a>
      </h5>
<p>
        The macro BOOST_VMD_IDENTITY_RESULT is in the same header file as BOOST_VMD_IDENTITY,
        so to use the BOOST_VMD_IDENTITY_RESULT macro either include the general
        header:
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">vmd</span><span class="special">/</span><span class="identifier">vmd</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre>
<p>
        or include the specific header:
      </p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">vmd</span><span class="special">/</span><span class="identifier">identity</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2010-2017 Tropic Software
      East Inc</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../vmd_useful.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../vmd_useful.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="vmd_empty_ppdata.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
